home *** CD-ROM | disk | FTP | other *** search
- Path: news.spies.com!usenet
- From: Erik Max Francis <max@alcyone.com>
- Newsgroups: comp.lang.c
- Subject: Re: File Open Problem - Please provide clues
- Date: Sun, 31 Mar 1996 19:13:26 -0800
- Organization: Alcyone Systems
- Message-ID: <315F49D6.7EC82EBB@alcyone.com>
- References: <4jkq8h$1it6@useneta1.news.prodigy.com>
- NNTP-Posting-Host: newton.alcyone.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.01 (X11; I; Linux 1.2.13 i486)
-
- Steve Bailey wrote:
-
- > Is there a way to manipulate an integer: store it in integer
- > variables, arrays, etc.., but then use that integer to open
- > a file actually named by that integer?..
- > I was going to name the files:
- > 0.txt, 1.txt, 2.txt,
- > and so forth, but this was even trickier with the string
- > concatenating, (attached ".txt" to it) etc.. so the files
- > are named after numbers simply..
-
- Convert it to a string with itoa or sprintf. Then strcat the suffix onto it.
- As always, make sure that are ensured you have adequate space reserved for your
- array.
-
- --
- Erik Max Francis &tSftDotIotE && http://www.alcyone.com/max && max@alcyone.com
- San Jose, California, U.S.A. && 37 20 07 N 121 53 38 W && the 4th R is respect
- H.3`S,3,P,3$S,#$Q,C`Q,3,P,3$S,#$Q,3`Q,3,P,C$Q,#(Q.#`-"C`- && 1love && folasade
- Omnia quia sunt, lumina sunt. && Dominion, GIGO, GOOGOL, Omega, Psi, Strategem
- "Out from his breast/his soul went to seek/the doom of the just." -- _Beowulf_
-